function checkIsIPRange(IPvalue){
	var errorString = "";
	var theName = "IPaddress";
	var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.\|(\d{1,3})-(\d{1,3})$/;
	var ipArray = IPvalue.match(ipPattern);	
	if (ipArray == null)
		var errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
		var extensionLength = 3;
	if (errorString == "")
		// alert ("That is a valid IP address.");
		return true;
	else
		return false;
}





function verifyIP (IPvalue) {
	var errorString = "";
	var theName = "IPaddress";

	var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/;
	var ipArray = IPvalue.match(ipPattern);

	if (IPvalue.match("0.0.0.0"))
		errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
	else if (IPvalue.match("255.255.255.255"))
		errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
	if (ipArray == null){
		errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
		return false;
	}
	else {
		for (var i = 1; i < 5; i++) {
			var thisSegment = ipArray[i];
			if (thisSegment > 255) {
				errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
				break;
			}
	    }
	}

	if (parseInt(ipArray[5])>32 || parseInt(ipArray[5])<0){
	    errorString = errorString + theName + ': '+IPvalue+' has a wrong mask.';
	}

	if (errorString == "")
		// alert ("That is a valid IP address.");
		return true;
	else
		return false;
		// alert (errorString);
}

